/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package medialibrary.persistence;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author user
 */
@Entity
@Table(name = "provider")

public class Provider implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "providerId")
    private Integer providerId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 32)
    @Column(name = "providerName")
    private String providerName;
    @Basic(optional = false)
    @NotNull
    @Column(name = "providerPhone")
    private long providerPhone;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 32)
    @Column(name = "providerEmail")
    private String providerEmail;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "providerId")
    private Collection<Ordre> order1Collection;

    public Provider() {
    }

    public Provider(Integer providerId) {
        this.providerId = providerId;
    }

    public Provider(Integer providerId, String providerName, long providerPhone, String providerEmail) {
        this.providerId = providerId;
        this.providerName = providerName;
        this.providerPhone = providerPhone;
        this.providerEmail = providerEmail;
    }

    public Integer getProviderId() {
        return providerId;
    }

    public void setProviderId(Integer providerId) {
        this.providerId = providerId;
    }

    public String getProviderName() {
        return providerName;
    }

    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    public long getProviderPhone() {
        return providerPhone;
    }

    public void setProviderPhone(long providerPhone) {
        this.providerPhone = providerPhone;
    }

    public String getProviderEmail() {
        return providerEmail;
    }

    public void setProviderEmail(String providerEmail) {
        this.providerEmail = providerEmail;
    }

    public Collection<Ordre> getOrder1Collection() {
        return order1Collection;
    }

    public void setOrder1Collection(Collection<Ordre> order1Collection) {
        this.order1Collection = order1Collection;
    }

    public String toString() {
        return providerId + "";
    }
    
}
